import { Entity, Column } from 'typeorm';
import { BaseEntity } from '../../../common/base.entity';

@Entity('base_sys_role', { schema: 'midway-admin' })
export class BaseSysRole extends BaseEntity {

  @Column('varchar', { name: 'name', comment: '名称', length: 255 })
  name: string;

  @Column('varchar', {
    name: 'label',
    nullable: true,
    comment: '角色标签',
    length: 50,
  })
  label: string | null;

  @Column('varchar', {
    name: 'remark',
    nullable: true,
    comment: '备注',
    length: 255,
  })
  remark: string | null;

  @Column('boolean', {
    name: 'relevance',
    default: false,
    comment: '数据权限是否关联上下级',
  })
  relevance: number;

  @Column('json', { name: 'menuList', nullable: true, comment: '菜单权限' })
  menuList: object;

  @Column('json', { name: 'deptList', nullable: true, comment: '部门权限' })
  deptList: object;
}
